import request from '@/utils/request'

/**
 * 新增部门
 * @data {code introduce manager name pid} data
 * @returns
 */
export function newDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
/**
 * 查询部门
 * @data {code introduce manager name pid} data
 * @returns
 */
export function getDepartment() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
/**
 * 根据 id 修改/编辑部门 详情
 * @data {code introduce manager name pid} data
 * @returns
 */
export function putDepartment(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
/**
 * 根据 id 删除部门
 * @data {code introduce manager name pid} data
 * @returns
 */
export function deleteDepartment(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}/**
 * 根据 id 查询部门 详情
 * @data {code introduce manager name pid} data
 * @returns
 */
export function getDepartmentDetails(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
